<template>
  <input type="text" v-bind="key"></input>
  <table border="1" cellspacing="0" cellpadding="10">
    <tr>
      <th>序号</th>
      <th>姓名</th>
      <th>年龄</th>
    </tr>
    <tr v-for="item in users" :key="item.id">
      <td>{{ item.id }}</td>
      <td>{{ item.name }}</td>
      <td>{{ item.ctime }}</td>
    </tr>
  </table>
</template>

<script lang="ts" setup>
import {ref} from "vue";
const name: any = ref('');
const id:any = ref(0);

const users =ref([
  {id:1,name:'向日葵',ctime:new Date()},
  {id:2,name:'非洲菊',ctime:new Date()},
])
const add=()=>{
  users.value.push({id:id.value,name:name.value,ctime:new Date()})
}
</script>

<style>

</style>
